package com.guigu.dispatch.feign;

import com.guigu.base.entity.BaseArea;
import com.guigu.base.entity.CourierScop;
import com.guigu.base.entity.TransportLine;
import com.guigu.base.entity.TransportTrips;
import com.guigu.base.entity.dto.TransportLineDto;
import com.guigu.base.entity.dto.TransportTripsTruckDriverDto;
import com.guigu.tms.result.R;
import com.guigu.work.dto.TaskTransportDTO;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName:BaseFeign
 * @Description:基础数据服务远程调用
 * @Author:taoLong
 * @Date:2021/11/19:9:28 星期五
 * @email:2391611102@qq.com or 2391611102qq@gmail.com
 */
@FeignClient(value = "service-base")
public interface BaseFeign {




    /**
     * 添加线路
     *
     * @param dto 线路信息
     * @return 线路信息
     */
    @PostMapping("/goods/pd-transport-line/")
    public R<TransportLineDto> saveTransportLine(@RequestBody TransportLineDto dto);


    /**
     * 根据起始机构Id和结束机构id来查找对应的线路信息
     *
     * @param startAgencyId 起始机构Id
     * @param endAgencyId   结束机构Id
     * @return
     */
    @GetMapping("/goods/pd-transport-line/getTransportLineById/{startAgencyId}/{endAgencyId}")
    public R<TransportLine> getTransportLineById(@PathVariable("startAgencyId") String startAgencyId,
                                                 @PathVariable("endAgencyId") String endAgencyId);

    /**
     * 根据id获取线路详情
     *
     * @param id 线路id
     * @return 线路详情
     */
    @GetMapping("/goods/pd-transport-line/{id}")
    @ApiOperation("根据id获取线路详情")
    public R<TransportLineDto> fineById(@PathVariable(name = "id") String id);


    /**
     * 根据线路Id来获取对应的车次集合数据
     *
     * @param lineId
     * @return
     */
    @ApiOperation("根据线路Id来获取对应的车次集合数据")
    @GetMapping("/goods/pd-transport-trips/findByLineID/{lineId}")
    public R<List<TransportTrips>> findByLineID(@PathVariable("lineId") String lineId);

    /**
     * 获取车次与车辆和司机关联关系列表
     *
     * @param transportTripsId 车次Id
     * @param truckId          车辆Id
     * @param userId           用户id
     * @return
     */
    @GetMapping("/goods/pd-transport-trips/truckDriver")
    @ApiOperation("获取车次与车辆和司机关联关系列表")
    public R<List<TransportTripsTruckDriverDto>> findAllTruckDriverTransportTrips(@RequestParam(name = "transportTripsId", required = false) String transportTripsId, @RequestParam(name = "truckId", required = false) String truckId, @RequestParam(name = "userId", required = false) String userId);



}
